<?php 
      echo $this->Html->css("chosen");
      echo $this->Html->css("validationEngine.jquery");
 ?>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/customInput.jquery.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/chosen.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/zice.custom1.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/manager_warehouse_invoice.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/layout_manager.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/jquery.validationEngine.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/jquery.validationEngine-vi.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/jquery.autotab.js"></script>

<div class="titlePage">
<h1>Quản lý kho sỉ - Nhập Kho</h1>
</div>

<div class="onecolumn vendor">
	<div class="header">
	<span>
		<span class="ico gray user"></span>
		ĐỐI TÁC
	</span>
	</div>
	<div class="clear"></div>
	<div class="content">
		<form id="validation">
			<div class="section">
				<label>
				Chọn đối tác:
				
				</label>
				<div id="search_vendor">
					 <select data-placeholder="Chọn đối tác..." class="chzn-select choose_vendor" tabindex="2" >
                          <option value=""></option> 
                          <?php foreach ($vendors as $item) {?>
							<option value="<?php echo $item['v']['id'].'_vendor'; ?>"><?php echo $item['v']['name'];}?></option>
                     </select>
					<a class="uibutton icon add addNewVendor">Thêm mới</a>					
				</div>
				<div id="result_vendor"></div>
			</div>
			
			<div class="newVendor">
				<h4> Đối tác mới</h4>
				<div class="section">
					<label>
					Chủ cửa hàng:
					</label>
					<div>
						<input class="validate[required] large" type="text" id="vendor_name"></div>
					</div>
				<div class="section">
					<label>
					Tên cửa hàng:
					</label>
					<div>
						<input class="validate[required] large" type="text" id="vendor_store"></div>
				</div>
				<div class="section numericonly">
					<label>
					Điện thoại bàn:
					</label>
					<div>
						<input class="validate[required,custom[phone]] large" type="text" id="vendor_phone"></div>
				</div>
				<div class="section numericonly">
					<label>
					Di động:
					</label>
					<div>
						<input class="validate[required,custom[phone]] large" type="text" id="vendor_mobile"></div>
				</div>
				<div class="section">
					<label>
					Địa chỉ:
					</label>
					<div>
						<input class="validate[required] large" type="text" id="vendor_address"></div>
				</div>
				<div class="buttonNewVendor">
					<a class="uibutton new_vendor"><span class="ico gray checkmark2 "></span>Lưu</a>
					<a class="uibutton special cancel"><span class="ico gray cross"></span>Hủy</a>
				</div>
			</div>
			<div class="newWarehouseInvoice" id='WarehouseInvoice'>
				<div id='result_choose_vendor'>
					
				</div>
				<h4> Danh sách sản phẩm nhập</h4>
				<div class="section listP nameListP">
					<label>
					Tên sản phẩm:
					</label>
				</div>
				<div class="section listP priceListP">
					<label>
					Giá sản phẩm:
					</label>
				</div>
				<div class="section listP countListP">
					<label>
					Số lượng:
					</label>
				</div>
				<div id="list_product">
				<div id='result_choose_product'></div>
				</div>
				<div>
					<div class="totalPrice"><h3>Tổng cộng: </h3></div><div id="sum_result" class="formatMoney">0 đ</div>
				</div>
				<div class="buttonNewListProduct">
					<a class="uibutton icon add" id='create_wh_invoice'>Tạo hóa đơn</a>
					<div id='btnPrintInvoice'></div>
				</div>
				<div id='alert_mes'></div>
			</div>
		</form>
	</div>
</div>

<div class="onecolumn product">
	<div class="header">
	<span>
		<span class="ico gray shopping_basket"></span>
		SẢN PHẨM
	</span>
	</div>
	<div class="clear"></div>
	<div class="content">
		<form id="validation">
			<div class="section">
				<label>
				Chọn sản phẩm:
				
				</label>
				<div id="search_product">
					<select data-placeholder="Chọn sản phẩm..." class="chzn-select choose_product" tabindex="2" >
                          <option value=""></option> 
                          <?php foreach ($products as $item) {?>
							<option value="<?php echo $item['p']['id'].'_product'; ?>"><?php echo $item['p']['name']." (".$item['u']['father']."/".$item['u']['convert']." ".$item['u']['child'].")";}?></option>
                     </select>
					
				</div>
				<label>
					Mã vạch:				
				</label>
				<div>
					<input class="validate[custom[onlyNumberSp]] large" type="text" id="product_barcode">
				</div>
				<div id="alert_product"></div>
			</div>
			<a class="uibutton icon add addNewProduct">Thêm mới</a>
			<div class="newProduct">
				<div class="section">
					<label>
					Tên sản phẩm:
					
					</label>
					<div>
						<input class="validate[required] large" type="text" id="product_name">
						
					</div>
				</div>
				<!-- <div class="section numericonly">
					<label>
					Giá sản phẩm:
					
					</label>
					<div>
						<input class="validate[required,custom[onlyNumberSp]] large" type="text" id="product_price">
						
					</div>
				</div> -->
				<div class="section">
					<label>
					Loại sản phẩm:
					
					</label>
					<div>
						<select id='product_type'>
						<?php foreach ($types as $item) {?>
							<option value="<?php echo $item['product_types']['id'] ?>"><?php echo $item['product_types']['name'];}?></option>
						</select>
						
					</div>
				</div>
				<div class="section">
					<label>
					Đơn vị tính:
					</label>
					<div>
						<select id='product_unit'>
							<?php foreach ($units as $item) {?>
							<option value="<?php echo $item['units']['id'] ?>"><?php echo $item['units']['father'].' / '.$item['units']['convert'].' '.$item['units']['child'];}?></option>
						</select>
					</div>
				</div>
				<div class="section">
					<label>
					Mã vạch:				
					</label>
					<div>
						<input class="validate[custom[onlyNumberSp]] large" type="text" id="barcode">
					</div>
				</div>
				<div class="buttonNewProduct">
					<a class="uibutton add_product"><span class="ico gray checkmark2"></span>Lưu</a>
					<a class="uibutton special cancel"><span class="ico gray cross"></span>Hủy</a>
				</div>
			</div>
		</form>
	</div>
</div>
